using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class PCI_MedicineMap : EntityTypeConfiguration<PCI_Medicine>
    {
        public PCI_MedicineMap()
        {
            // Primary Key
            this.HasKey(t => t.past_medicine_id);

            // Properties
            this.Property(t => t.isPreoperative)
                .HasMaxLength(10);

            this.Property(t => t.create_by)
                .HasMaxLength(20);

            this.Property(t => t.update_by)
                .HasMaxLength(20);

            this.Property(t => t.Past_medicine_name)
                .HasMaxLength(50);

            this.Property(t => t.drug_type_Name)
                .HasMaxLength(50);

            this.Property(t => t.dosage)
                .HasMaxLength(50);

            this.Property(t => t.Usage_type)
                .HasMaxLength(20);

            this.Property(t => t.badOther)
                .HasMaxLength(200);

            this.Property(t => t.badText)
                .HasMaxLength(500);

            this.Property(t => t.Unit)
                .HasMaxLength(20);

            this.Property(t => t.MedicationAdherence)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("PCI_Medicine");
            this.Property(t => t.past_medicine_id).HasColumnName("past_medicine_id");
            this.Property(t => t.isPreoperative).HasColumnName("isPreoperative");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");
            this.Property(t => t.create_time).HasColumnName("create_time");
            this.Property(t => t.create_by).HasColumnName("create_by");
            this.Property(t => t.update_time).HasColumnName("update_time");
            this.Property(t => t.update_by).HasColumnName("update_by");
            this.Property(t => t.Past_medicine_name).HasColumnName("Past_medicine_name");
            this.Property(t => t.drug_type_Name).HasColumnName("drug_type_Name");
            this.Property(t => t.drug_type_id).HasColumnName("drug_type_id");
            this.Property(t => t.dosage).HasColumnName("dosage");
            this.Property(t => t.Usage_type).HasColumnName("Usage_type");
            this.Property(t => t.bad1).HasColumnName("bad1");
            this.Property(t => t.bad2).HasColumnName("bad2");
            this.Property(t => t.bad3).HasColumnName("bad3");
            this.Property(t => t.badOther).HasColumnName("badOther");
            this.Property(t => t.badText).HasColumnName("badText");
            this.Property(t => t.Unit).HasColumnName("Unit");
            this.Property(t => t.MedicationAdherence).HasColumnName("MedicationAdherence");
        }
    }
}
